home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Environments / SmallEiffel 0.3.3 / SmallEiffel 68k / lib_test / test_pre_once1.e < prev    next >
Encoding:
Text File  |  1996-06-13  |  783 b   |  45 lines  |  [TEXT/EDIT]

  1. -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C) 
  2. -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
  3. --
  4. class TEST_PRE_ONCE1
  5.  
  6. creation make
  7.  
  8. feature
  9.  
  10.    make is
  11.       do
  12.      is_true(max = 255);
  13.      is_true(foo.is_equal("hip hop"));
  14.       end;
  15.  
  16.    max: INTEGER is
  17.       once
  18.          Result := 255
  19.       ensure 
  20.      meaningful: Result >= 127
  21.       end
  22.  
  23.    foo: STRING is
  24.       once
  25.      Result := "hip hop";
  26.       ensure
  27.      Result.is_equal("hip hop");
  28.       end;
  29.  
  30.    is_true(b: BOOLEAN) is
  31.       do
  32.      cpt := cpt + 1;
  33.      if not b then
  34.         std_output.put_string("TEST_PRE_ONCE1: ERROR Test # ");
  35.         std_output.put_integer(cpt);
  36.         std_output.put_string("%N");
  37.      else
  38.         -- std_output.put_string("Yes%N");
  39.      end;
  40.       end;
  41.    
  42.    cpt: INTEGER;
  43.  
  44. end -- TEST_PRE_ONCE1
  45.